package opgave2;

public class Knoop<E extends Data> implements Cloneable {

    E data;
    Knoop<E> prior,
             next;
    

    public Knoop (E d) {
	    this(d, null, null);
    }


    public Knoop (E d, Knoop p, Knoop n) {
	    data = d == null ? null : (E) d.clone();
	    prior = p;
	    next = n;
    }

    public Knoop<E> clone () {
	    Knoop<E> kopie;

	    try {
	        kopie = (Knoop<E>) super.clone();
	    } catch (CloneNotSupportedException e) {
	        throw new Error("Onmogelijk! instantie Knoop is niet Cloneable");
	    }

        kopie.data = data == null ? null : (E) data.clone();

	    return kopie;
    }

}
